package com.macro.mall.portal.repository;

import com.macro.mall.portal.domain.MemberReadHistory;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.PageRequest;
import org.springframework.data.mongodb.repository.MongoRepository;

import java.util.Collection;


/**
 * @author wangwang
 * @version 1.0
 * @description 会员浏览记录Repository
 * @date 2025/8/2 9:42
 */
public interface MemberReadHistoryRepository extends MongoRepository<MemberReadHistory,String> {
    /*
     * 根据id批量删除
     */
    void deleteAllByIdIn(Collection<String> ids);

    /**
     * 根据会员ID分页查找记录
     */
    Page<MemberReadHistory> findByMemberId(Long MemberId, PageRequest pageRequest);

    /**
     * 根据会员ID删除记录
     */
    void deleteAllByMemberId(Long id);
}
